<template>
  <hierTree
    :data="data"
    v-bind="attrs"
    :ref="ref"
    @select="select"
    @add="add"
    @remove="remove"
    @menu="menu"
  ></hierTree>
</template>

<script>
const ref = "mainTree";
export default {
  name: ref,
  components: {},
  inject: ["anc"],
  data() {
    return {
      ref,
      loading: false,
    };
  },
  props: {
    data: {
      default: () => {
        return [];
      },
    },
  },
  watch: {},
  computed: {
    attrs() {
      return {
        title: {
          "en-US": "AAA",
          "zh-CN": "AAA",
        }[this.G_Locale],
        rootId: "root",
        nameId: "id",
        namePid: "parentId",
        nameTitle: "name",
        rootEnable: false,
        menuEnable: false,
        addEnable: false,
        removeEnable: false,
        menus: [
          {
            title: {
              "en-US": "add1",
              "zh-CN": "添加1",
            }[this.G_Locale],
            disabled: false,
          },
        ],
      };
    },
  },
  created() {},
  mounted() {
    this.$nextTick(() => {
      this.$set(this.anc.vms, this.ref, this);
    });
  },
  methods: {
    select(item, data) {
      this.anc.treeSelect(item, data);
    },
    add(item) {},
    remove(item) {},
    menu(menu, item) {},
  },
};
</script>
<style scoped></style>
